import board
import digitalio
import time

led = digitalio.DigitalInOut(board.GPIO7)
led.direction = digitalio.Direction.OUTPUT

try:
    while True:
        led.value=1
        time.sleep(0.5)
        led.value=0
        time.sleep(0.5)

finally:
    led.value = False
    led.deinit()
